import { Global, Module } from '@nestjs/common';
import Redis from 'ioredis';
import config from '../../../config';

@Global()
@Module({
  providers: [
    {
      provide: 'REDIS',
      useValue: new Redis({
        host: config.redis.host,
        port: config.redis.port,
      }),
    },
  ],
  exports: ['REDIS'],
})
export class RedisModule {}
